package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.EmsCalculationDataConfig;
import com.econ.powercloud.ems.dal.mapper.EmsCalculationDataConfigMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author hcx
 * @since 2023/12/11 9:58
 **/
@Repository
public class EmsCalculationDataConfigDAO extends ServiceImpl<EmsCalculationDataConfigMapper, EmsCalculationDataConfig> {

    /**
     * 通过簇code获取数据
     */
    public List<EmsCalculationDataConfig> getListByType(List<String> types){
        LambdaQueryWrapper<EmsCalculationDataConfig> wrapper = Wrappers.lambdaQuery();
        wrapper.in(EmsCalculationDataConfig::getMatchTypeTag,types);
        return this.baseMapper.selectList(wrapper);
    }
}
